/*
 * dice.h
 *
 *  Created on: May 26, 2011
 *      Author: Darth Tanner
 */

#ifndef DICE_H_
#define DICE_H_

//------------------------------------------------------------------------------
// INITIALIZE CONSTANTS FOR TONES
//
#define myCLOCK	8000000					// clock speed
#define WD_CLK	32						// 32 Khz WD clock (@1 Mhz)
#define	WD_1SEC_CNT	myCLOCK/32000		// WD counts/second (32 ms)
#define	WDT_CTL	WDT_MDLY_32				// WDT SMCLK, ~32ms
#define	WDT_CPS	myCLOCK/WDT_CLK			// WD clocks / second count

#define DIE_POSITION 58					// Where the column for die is to go

#define DIE_ONE 18

#define DIE_TWO 88

#define FALSE 0							// Define the boolean for false
#define TRUE 1							// Define the boolean for true

// Dice prototypes
int flashLed(void);
int	ledsOff(void);
int lightLed(int led);
int signifyRoll(void);
int writeDie1(void);
int writeDie2(void);
int rollDice(void);
int randomRollDice(void);
int compareRolls(void);
int playCharge(void);
int playTone(double frequency, int length);





#endif /* DICE_H_ */
